<?
 require("users.php");
 

 if(isset($_POST['createNew']))
 {	
	$results = addUsers($_POST);
	
 	if($_POST['createNew'] === '1')
 	{	
		if($results === TRUE)
		{
			header("location:list.php");
		}
		else
		{
			$row = $_POST;			
		}
 	}
 }
 else
 {
 	//$row = emptyUser();
	
 }

?>
<!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title><?=$title ?> New Customer</title>
         <? require('../inc/header-info.php'); ?>
    </head>
    <body>
        <div class="container">
            <? include('../inc/nav.php'); ?>
             <form name="form1" method="post" action="create.php">
             	<h4>Create New Customer</h4>
             	<input type="hidden" name="createNew" value='1'> 
            	
					<label class="control-label" for="first_name">First Name:</label>
					<div class="controls">
						<input type="text" id="first_name"  name="first_name" placeholder="First Name">
					</div>
				
				
					<label class="control-label" for="middle_name">Middle Name:</label>
					<div class="controls">
						<input type="text" id="middle_name" name="middle_name" placeholder="Middle Name">
					</div>
				
					<label class="control-label" for="last_name">Last Name:</label>
					<div class="controls">
						<input type="text" id="last_name" name="last_name" placeholder="Last Name">
					</div>
    			
            	<div class="form-actions">
  					<button type="submit" class="btn btn-primary">New Customer</button>
					<button type="button" class="btn">Cancel</button>
				</div>	
            </form> 
		</div>
		
		<script type="text/javascript">
                        $(function()
                        {
                                
                                $("form1").validate({
                                        rules: {
                                                middle_name: { required: true }
                                        }
                                });
                                
                        });
           </script>
	</body>
</html>
